﻿using System.Windows.Input;
using Acme.Common.Infrastructure;
using Acme.MVVM.Scenarios.Events;
using Acme.Prism.Infrastructure;

namespace Acme.MVVM.Scenarios.Views
{
    public class PublisherViewModel
    {

        readonly IEventAggregatorResolver<PubSubDemoEvent> _pubEvent;

        public ICommand PublishCommand
        {
            get { return new RelayCommand(() => _pubEvent.Resolve().Publish("Hello from publisher")); }
        }

        public PublisherViewModel(IEventAggregatorResolver<PubSubDemoEvent> pubEvent)
        {
            _pubEvent = pubEvent;
        }
    }
}
